package zhtt.demo01;

/**
 * Created by zhtt on 2017/4/29.
 */
public class User {

    private Integer id;

    private String name;

    private Integer deptId;

    private Dept dept;

    public User() {
    }


    public User(Integer deptId, String name ) {
        this.name = name;
        this.deptId = deptId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getDeptId() {
        return deptId;
    }

    public void setDeptId(Integer deptId) {
        this.deptId = deptId;
    }

    public Dept getDept() {
        return dept;
    }

    public void setDept(Dept dept) {
        this.dept = dept;
    }

    @Override
    public String toString() {
        return "User{" +
                "deptId=" + deptId +
                (dept==null?",dept=null":",dept="+dept.getName()+"-->"+dept.getId())+
                ", name='" + name + '\'' +
                ", id=" + id +
                '}';
    }
}
